home *** CD-ROM | disk | FTP | other *** search
- package symantec.itools.db.net;
-
- import java.io.IOException;
- import java.io.InputStream;
- import java.io.OutputStream;
- import java.net.Socket;
- import symjava.sql.SQLException;
-
- // $FF: renamed from: symantec.itools.db.net.IO
- class class_0 {
- Socket _sock;
- InputStream _userIS;
- OutputStream _readerOS;
- OutputStream _userOS;
- SocketWriter _writer;
- SocketReader _reader;
- short _id;
-
- class_0(MPlex mplex, Socket s, short streamID) throws NetException {
- try {
- this._sock = s;
- this._id = streamID;
- this._userIS = new SocketIS(this._sock.getInputStream(), mplex);
- this._writer = new SocketWriter(this._sock.getOutputStream());
- this._userOS = new NetOutputStream(this._writer, streamID);
- } catch (IOException var4) {
- throw new NetException("Error constructing IO object");
- } catch (SQLException var5) {
- throw new NetException("Error constructing IO object");
- }
- }
-
- class_0(SocketWriter ostr, short streamID) throws NetException {
- try {
- this._sock = null;
- this._id = streamID;
- this._userIS = new NetPipedInputStream();
- this._readerOS = new NetPipedOutputStream((NetPipedInputStream)this._userIS);
- this._userOS = new NetOutputStream(ostr, streamID);
- this._reader = null;
- this._writer = ostr;
- } catch (IOException var3) {
- throw new NetException("Error constructing IO object");
- }
- }
-
- class_0(SocketWriter ostr, InputStream istr, short streamID) throws NetException {
- this._sock = null;
- this._id = streamID;
- this._userIS = istr;
- this._readerOS = null;
- this._userOS = new NetOutputStream(ostr, streamID);
- this._reader = null;
- this._writer = ostr;
- }
-
- void close() {
- if (this._reader != null && this._reader.isAlive()) {
- this._reader.stop();
-
- while(this._reader.isAlive()) {
- try {
- Thread.sleep(10L);
- } catch (Exception var3) {
- }
- }
- }
-
- try {
- if (this._sock != null) {
- this._sock.close();
- return;
- }
- } catch (Exception e) {
- ((Throwable)e).printStackTrace();
- }
-
- }
-
- InputStream getInputStream() {
- return this._userIS;
- }
-
- OutputStream getOutputStream() {
- return this._userOS;
- }
- }
-